<%--
  Created by IntelliJ IDEA.
  User: lb
  Date: 15-11-27
  Time: 上午11:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<html>
<head>
    <title>管理员查看所有转让</title>
    <script src="/static/bootstrap/js/bootstrap-paginator.js"></script>
    <script>
        $(function () {
            var totalPage = $("#totalPage").val();
            var currentPage = $("#currentPage").val();
            var status = $("#status").val();
            var options = {
                bootstrapMajorVersion: 3,
                currentPage: currentPage,
                totalPages: totalPage,
                size: "normal",
                alignment: "center",
                itemTexts: function (type, page, current) {
                    switch (type) {
                        case "first":
                            return "首页";
                        case "prev":
                            return "上一页";
                        case "next":
                            return "下一页";
                        case "last":
                            return "末页";
                        case "page":
                            return page;
                    }
                },
                onPageClicked: function (e, originalEvent, type, page) {
                    window.location.href = '/assignmentback/showall/' + page + '/' + status;
                }
            }
            $("#pager").bootstrapPaginator(options);
        });
    </script>
</head>
<body>
<br/>
<a href="/assignmentback/showall/1/ALL">全部</a>
<a href="/assignmentback/showall/1/TOASSIGNMNET">放入转让池</a>
<a href="/assignmentback/showall/1/ASSIGNMENTED">完成转让</a>
<br/>
<table class="table table-striped">
    <thead>
    <th>名称</th>
    <th>户型</th>
    <th>所有者</th>
    <th>状态</th>
    <th>myHouse状态</th>
    <th>详情</th>
    </thead>
    <tbody>
    <c:forEach items="${assignmentDTOs}" var="assignmentDTO">
        <tr>
            <td>${assignmentDTO.myHouseDTO.houseInfoDTO.name}</td>
            <td>${assignmentDTO.myHouseDTO.houseInfoDTO.houseType}</td>
            <td>${assignmentDTO.userName}</td>
            <td>${assignmentDTO.myHouseStatus}</td>
            <td>${assignmentDTO.myHouseDTO.myHouseStatus}</td>
            <td><a href="/assignmentback/assignmentdetails/${assignmentDTO.guid}">查看详情</a></td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div style="text-align: center;">
    <input type="hidden" id="totalPage" value="${totalPage}">
    <input type="hidden" id="currentPage" value="${currentPage}">
    <input type="hidden" id="status" value="${status}">
    <ul id="pager"></ul>
</div>
</body>
</html>